﻿using GYCTOAManagementSystemNewApi.Model.Entity;
using GYCTOAManagementSystemNewApi.Model.Request;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Internal;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace GYCTOAManagementSystemNewApi.Model.Tool
{
    public class DBContext : DbContext
    {
        public DBContext(DbContextOptions<DBContext> options) : base(options)
        {

        }
        public DBContext()
        {

        }

        //override protected void OnConfiguring(DbContextOptionsBuilder optionsBuilder) 
        //{
        //    base.OnConfiguring(optionsBuilder);
        //    //string config = ConfigurationHelper.GetConfigValueByKey("ConnectionStrings:DefaultConnection");
        //    //optionsBuilder.UseMySql(config);
        //}






        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);
        }

        public virtual DbSet<Users> Users { get; set; }
        public virtual DbSet<Role> Role { get; set; }
        public virtual DbSet<AuditRule> AuditRule { get; set; }
        public virtual DbSet<FinanceLoan> FinanceLoan { get; set; }
        //public virtual DbSet<PublicAudit> PublicAudit { get; set; } 
        public virtual DbSet<Project> Project { get; set; }

        public virtual DbSet<MessageTable> MessageTable { get; set; }
        public virtual DbSet<FinanceCollection> FinanceCollection { get; set; }
        public virtual DbSet<FinanceReimbursement> FinanceReimbursement { get; set; }

        public virtual DbSet<QuartZShortMessageModel> QuartZShortMessageModel { get; set; }
        public virtual DbSet<UsageRecord> UsageRecord { get; set; }
        public virtual DbSet<Performances> Performances { get; set; }
        public virtual DbSet<PrivateCarUtilityModel> PrivateCarUtilityModel { get; set; }
        public virtual DbSet<rolemenu> rolemenu { get; set; }

        #region CertificateManagement 证书管理  AccountManagement 账号管理

        /// <summary>
        /// 证书管理
        /// </summary>
        public virtual DbSet<CertificateManagement> CertificateManagement { get; set; }

        /// <summary>
        ///  账号管理
        /// </summary>
        public virtual DbSet<AccountManagement> AccountManagement { get; set; }
        #endregion

        #region 考勤
        public virtual DbSet<BusinessTravel> BusinessTravel { get; set; }
        public virtual DbSet<Addwork> Addwork { get; set; }
        #endregion


        #region 收方工资单
        public virtual DbSet<PayrollForm> PayrollForm { get; set; }
        public virtual DbSet<FormUser> FormUser { get; set; }
        #endregion

        #region 豪度报销
        /// <summary>
        /// 报销
        /// </summary>
        public virtual DbSet<FinanceReimbursementReim> FinanceReimbursementReim { get; set; }
        /// <summary>
        /// 报销细则
        /// </summary>
        public virtual DbSet<ReimRule> ReimRule { get; set; }

        /// <summary>
        /// 生活费报销
        /// </summary>
        public virtual DbSet<Livingexpenses> Livingexpenses { get; set; }
        public virtual DbSet<LivingexpensesInfo> LivingexpensesInfo { get; set; }
        /// <summary>
        /// 社保表
        /// </summary>
        public virtual DbSet<SocialinsuranceData> SocialinsuranceData { get; set; }
        #endregion
    }

    //删除测试数据内容
    //truncate table    PayrollForm                      ;
    // truncate table    FormUser                         ;
    // truncate table    FinanceReimbursementReim         ;
    // truncate table    ReimRule                         ;
    // truncate table    Livingexpenses                   ;
    // truncate table    LivingexpensesInfo               ;
    // truncate table   SocialinsuranceData               ;

}
